package com.jbm.core.client.remote;

import com.jbm.core.common.AccountCtrl;
import com.jbm.core.common.ConnectAgent;
import com.jbm.core.common.MainServer;
import com.jbm.core.iface.IAcross;
import com.jbm.core.iface.IConnectAgent;

/**
 * Created by root on 17-3-5.
 */
public class RIConnectAgent extends IConnectAgent
{
	public RIConnectAgent()
	{
	}

	public RIConnectAgent(IAcross ia)
	{
		super(ia);
	}

	public IAcross PushCA()
	{
		ConnectAgent proxy = AccountCtrl.g_accountctrl.GetCA(AccountCtrl.Account_Server_id,"app_server");

		ConnectAgent ca = new ConnectAgent((IConnectAgent)m_input, MainServer.Server_type_Client, proxy,MainServer.g_server.getM_localport());

		AccountCtrl.g_accountctrl.PushPoint(((IConnectAgent)m_input).getM_acc_id_4_arcross(),ca);

//		System.out.println(m_pbcontent.toString());

		return new IAcross(200,"OK");
	}

	public IAcross OfflineCA()
	{
		ConnectAgent proxy = AccountCtrl.g_accountctrl.GetCA(AccountCtrl.Account_Server_id,"app_server");

		ConnectAgent ca = new ConnectAgent((IConnectAgent)m_input, MainServer.Server_type_Client, proxy,MainServer.g_server.getM_localport());

		AccountCtrl.g_accountctrl.OfflinePoint(((IConnectAgent)m_input).getM_acc_id_4_arcross(),ca);

//		System.out.println(m_pbcontent.toString());

		return new IAcross(200,"OK");
	}
}
